# 抖码算法，让算法学习变得简单有趣
# 作者：老汤

n = int(input())
if n < 4:
    print(0)
    exit(0)

points = [[0, 0] for i in range(n)]
for i in range(n):
    data = str(input()).split(" ")
    points[i][0] = int(data[0])
    points[i][1] = int(data[1])


def dist(p1, p2):
    return (p2[1] - p1[1]) * (p2[1] - p1[1]) + (p2[0] - p1[0]) * (p2[0] - p1[0])


def check(p1, p2, p3, p4):
    return (dist(p1, p2) > 0
            and dist(p1, p2) == dist(p2, p3)
            and dist(p2, p3) == dist(p3, p4)
            and dist(p3, p4) == dist(p4, p1)
            and dist(p1, p3) == dist(p2, p4))


# 如何验证四个点是否是正方形，请参考：https://leetcode.cn/problems/valid-square/solution/you-xiao-de-zheng-fang-xing-by-leetcode/
def valid_square(p1, p2, p3, p4):
    return check(p1, p2, p3, p4) or check(p1, p3, p2, p4) or check(p1, p2, p4, p3)


# 因为题目规定的输入数据规模是 100，所以可以暴力枚举
res = 0
for i in range(n - 3):
    for j in range(i + 1, n - 2):
        for k in range(j + 1, n - 1):
            for l in range(k + 1, n):
                # 验证四个点是否是正方形
                if valid_square(points[i], points[j], points[k], points[l]):
                    res += 1

print(res)